<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<div class="clrboth"></div>
<?php echo $phpJS;?>

<div id="center-wrap" class="ui-corner-tl ui-corner-tr">
	<div id="navigation" class="ui-corner-all"><ul><?php echo $navigator;?></ul></div>
	
	<div class="clrboth"></div>	
	<?php 
		$ci = &get_instance();
		$SHOW = $items['show'];
		$bidStatus = bidStatusDataConfig();
	?>
	
	<div class="row">
		<div class="column grid_9">
			<p class="bold"> &raquo; Who Bib On This Show:</p>
		</div>
	</div>
	<div class="clrboth"></div>
	
	<div style="width:0px;height:30px;"></div>

	<div class="clrboth"></div>
	<div id="result_display">
		<table>
			<thead>
				<td width="200px">User Name</td>
				<td width="200px">Bid Details</td>
				<td width="200px">Bid Date</td>
				<td width="100px">Status</td>
			</thead>
			<tbody>
			 
				<?php if(!empty($items['bid'])):?>
					<?php foreach($items['bid'] as $object):?>
						<?php $USER = $ci->user_entity->init('acc_code', $object->account_code) ;?>
						<tr>
							<td><a href="<?php echo site_url("seller/buyer_information/".$USER->getAccCode());?>"><?php echo $USER->getFirstName()." ".$USER->getLastName();?></a></td>
							<td><a class="manage ui-corner-all" href="<?php echo site_url("seller/show_manage/bid_details/?show_id=".$SHOW->getId()."&bid_id=".$object->id);?>">View</a></td>
							<td><?php echo sbxDateFormat($object->date_bid,'d/M/Y');?></td>
							<td>
								<?php if( $SHOW->getStatus() == "opening" ):?>
									<?php echo $bidStatus["bidding"];?>
								<?php elseif( $SHOW->getStatus() == "closed" ) : ?>
									<?php 
										if($SHOW->getUserBidWon() == $USER->getId()){
											echo $bidStatus["won"];
										}else{
											echo $bidStatus["lost"];
										}	
									?>
								<?php endif;?>
							</td>
						</tr>
					<?php endforeach; ?>
				<?php endif; ?>
			</tbody>
		</table>
	</div>
	
	<div class="clrboth"></div>
	
	<div class="clrboth"></div>
	<div style="width:0px;height:30px;"></div>
	<div class="clrboth"></div>

</div>
<div class="clrboth"></div>

<script type="text/javascript">
	$(function(){
		
	});
	
</script>
